package exam;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * @author げっしょく
 * @date 2021/7/28
 */
public class Test2 {
    public static void main(String[] args) {
        methon();
        //methon2();
    }

    private static void methon2() {
        HashMap<String, String> hm = new HashMap<>();
        hm.put("zhangsan", "lisi");
        hm.put("wang", "zhaoliu");
        hm.put("qi", "qian");
        hm.keySet().stream().forEach(s -> System.out.println(s));
        hm.values().stream().forEach(s -> System.out.println(s));
        hm.entrySet().stream().forEach(stringStringEntry -> System.out.println(stringStringEntry));
    }

    private static void methon() {
        ArrayList<String> list = new ArrayList<>();
        list.add("张三丰");
        list.add("无语子");
        list.add("贾乃亮");
        list.add("王宝强");
        list.add("邹清泉");
        list.add("是一个牛马");
        list.stream().skip(2).filter(s -> s.length() < 4).distinct().forEach(s -> System.out.println(s));
    }
}
